﻿namespace ScrumLite.WebUx.Tests
{
    using System;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Linq;
    using ScrumLite.Services;
    using ScrumLite.Services.Contracts;

    public class MockAbilitiesService : IAbilitiesService
    {
        public bool GetAbilitiesCalled { get; set; }
     
        private static List<Ability> abilities;

        private static void Initialize()
        {
            abilities = new List<Ability>();
            abilities.Add(new Ability { Id = Guid.NewGuid(), Name = "C#" });
            abilities.Add(new Ability { Id = Guid.NewGuid(), Name = "ASP.Net" });
            abilities.Add(new Ability { Id = Guid.NewGuid(), Name = "Security Token Service (STS)" });
            abilities.Add(new Ability { Id = Guid.NewGuid(), Name = "Windows Comunication Foundation (WCF)" });
            abilities.Add(new Ability { Id = Guid.NewGuid(), Name = "Cardspace" });
        }

        public Ability[] GetAbilities()
        {
            Initialize();
            this.GetAbilitiesCalled = true;

            var roleAbilities = (from a in abilities
                                   select a).ToList();

            return roleAbilities.ToArray();
        }
    }
}
